package andy.ham;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.os.Handler;
import android.os.Message;

/**
 * Created by winner on 2018/6/17.
 */

public class Cover extends Activity{

    boolean k=false;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.cover);
        handler.sendEmptyMessageDelayed(0,3000);
        Button button=(Button)findViewById(R.id.pass);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Cover.this, LifeDiary.class);
                startActivity(intent);
                Cover.this.finish();
                k=true;
            }
        });
    }
    private Handler handler=new Handler()
    {
        public void handleMessage(Message msg)
        {
            getHome();
            super.handleMessage(msg);
        }
    };
    public void getHome()
    {
        if(k==false)
        {
            Intent intent = new Intent(Cover.this, LifeDiary.class);
            startActivity(intent);
            Cover.this.finish();
        }
    }
}
